xen_ia64_tlbflush_clock ?= y
xen_ia64_disable_optvfault ?= n
+# If they are enabled,
+# shrink struct page_info assuming all mfn can be addressed by 32 bits.
+# However, with 50bit ia64 architected physical address and 16KB page size,
+# mfn isn't always assessed by 32bit. So they are disabled by default.
+xen_ia64_shrink_page_list ?= n
+xen_ia64_pickle_domain ?= n
+
# Used only by linux/Makefile.
AFLAGS_KERNEL += -mconstant-gp -nostdinc $(CPPFLAGS)
ifeq ($(xen_ia64_disable_optvfault),y)
CFLAGS += -DCONFIG_XEN_IA64_DISABLE_OPTVFAULT
endif
+ifeq ($(xen_ia64_shrink_page_list),y)
+CFLAGS += -DCONFIG_IA64_SHRINK_PAGE_LIST
+endif
+ifeq ($(xen_ia64_pickle_domain),y)
+CFLAGS += -DCONFIG_IA64_PICKLE_DOMAIN
+endif
LDFLAGS = -g
struct domain *alloc_domain_struct(void)
{
- return xmalloc(struct domain);
+#ifdef CONFIG_IA64_PICKLE_DOMAIN
+ struct domain *d;
+ /*
+ * We pack the MFN of the domain structure into a 32-bit field within
+ * the page_info structure. Hence the MEMF_bits() restriction.
+ */
+ d = alloc_xenheap_pages(get_order_from_bytes(sizeof(*d)),
+ MEMF_bits(32 + PAGE_SHIFT));
+ if ( d != NULL )
+ memset(d, 0, sizeof(*d));
+ return d;
+#else
+ return xmalloc(struct domain);
+#endif
}
void free_domain_struct(struct domain *d)
{
- xfree(d);
+#ifdef CONFIG_IA64_PICKLE_DOMAIN
+ free_xenheap_pages(d, get_order_from_bytes(sizeof(*d)));
+#else
+ xfree(d);
+#endif
}
struct vcpu *alloc_vcpu_struct(void)
#define PRtype_info "016lx"
-#if 0
+#ifdef CONFIG_IA64_SHRINK_PAGE_LIST
/*
* See include/xen/mm.h.
- * For now, abandon to compress struct page_info
- * seeing IA64_MAX_PHYS_BITS and page size.
+ * To compress page_list_entry, all the physical address must
+ * be addressed by (32 + PAGE_SHIFT) .
+ * However this is lower than IA64_MAX_PHYS_BITS = 50.
*/
#undef page_list_entry
struct page_list_entry
{
- unsigned long next, prev;
+ u32 next, prev;
};
#endif
+#ifdef CONFIG_IA64_PICKLE_DOMAIN
+typedef u32 __ia64_domain_t;
+#else
+typedef unsigned long __ia64_domain_t;
+#endif
+
struct page_info
{
/* Each frame can be threaded onto a doubly-linked list. */
/* Page is in use: ((count_info & PGC_count_mask) != 0). */
struct {
- /* Owner of this page (NULL if page is anonymous). */
- unsigned long _domain; /* pickled format */
/* Type reference count and various PGT_xxx flags and fields. */
unsigned long type_info;
+ /* Owner of this page (NULL if page is anonymous). */
+ __ia64_domain_t _domain; /* pickled format */
} inuse;
/* Page is on a free list: ((count_info & PGC_count_mask) == 0). */
#define is_xen_heap_mfn(mfn) (mfn_valid(mfn) && \
is_xen_heap_page(mfn_to_page(mfn)))
+#ifdef CONFIG_IA64_PICKLE_DOMAIN
+#define page_get_owner(_p) \
+ ((struct domain *)((_p)->v.inuse._domain ? \
+ mfn_to_virt((_p)->v.inuse._domain) : NULL))
+#define page_set_owner(_p,_d) \
+ ((_p)->v.inuse._domain = (_d) ? virt_to_mfn(_d) : 0)
+#else
#define page_get_owner(_p) ((struct domain *)(_p)->u.inuse._domain)
#define page_set_owner(_p, _d) ((_p)->u.inuse._domain = (unsigned long)(_d))
+#endif
#define XENSHARE_writable 0
#define XENSHARE_readonly 1